import request from '@/utils/request'

const api_name = '/admin/user'

export default {
	//讲师列表
    pageList(page, limit, searchObj) {
        return request({
            url: `${api_name}/${page}/${limit}`,
            method: `post`,
            data: searchObj
        })
    },
    removeById(id) {
        return request({
          url: `${api_name}/remove/${id}`,
          method: `delete`
        })
      },

      save(user) {
        return request({
          url: `${api_name}/save`,
          method: `post`,
          data: user
        })
      },
      getById(id) {
        return request({
            url: `${api_name}/get/${id}`,
            method: `get`
        })
    },
    findAll() {
      return request({
          url: `${api_name}/findAll`,
          method: `get`
      })
  },
    updateById(user) {
        return request({
          url: `${api_name}/update`,
          method: `put`,
          data: user
        })
      },
      // 批量删除用户
      batchRemove(idList) {
        return request({
          url: `${api_name}/batch-remove`,
          method: `delete`,
          data: idList
        })
      },

      // getUserNames 
      getUserNames() {
        return request({
            url: `${api_name}/getUserNames`,
            method: `get`
        })
    },

}